/**
 * 
 */
package be.gwi.alfresco.run.service;

import java.util.List;

import be.gwi.alfresco.run.exception.ServiceException;
import be.gwi.alfresco.run.model.Run;
import be.gwi.alfresco.run.model.RunType;
import be.gwi.alfresco.run.model.Runner;

/**
 * Runner Service will provide services about runners
 * 
 * @author gabriel.wilems@gmail.com
 * 
 * @version 1.0
 * @since 1.0
 */
public interface RunnerService {
    /**
     * Get a runner bean from the given username
     * 
     * @param username
     * @return
     * @throws ServiceException
     */
    Runner getRunner(String username) throws ServiceException;

    /**
     * Get the current runner bean
     * 
     * @return
     * @throws ServiceException
     */
    Runner getCurrentRunner() throws ServiceException;

    /**
     * Register new Run for the current user
     * 
     * @param run
     * @throws ServiceException 
     */
    void addRun(Run run) throws ServiceException;
    
    /**
     * Get runner history for the given year
     * 
     * @param username
     * @param year
     * @return
     * @throws ServiceException
     */
    List<Run> getHistory(String username, String year) throws ServiceException;

    /**
     * Get current history for the given year
     * 
     * @param year
     * @return
     * @throws ServiceException
     */
    List<Run> getCurrentHistory(String year) throws ServiceException;

    /**
     * Get runner history for the given runType
     * 
     * @param username
     * @param runType
     * @return
     * @throws ServiceException
     */
    List<Run> getHistoryByRunType(String username, RunType runType) throws ServiceException;

    /**
     * Get current history for the given runType
     * 
     * @param runType
     * @return
     * @throws ServiceException
     */
    List<Run> getCurrentHistoryByRunType(RunType runType) throws ServiceException;

    /**
     * Get ranking for the given runType
     * 
     * @param runType
     * @return
     * @throws ServiceException
     */
    List<Runner> getRanking(RunType runType) throws ServiceException;
}
